<script type="text/javascript">
	$(document).ready(function(){
		$.validator.messages.required = "";
		$.validator.messages.date = "";
		$("#FormDangBaiViet").validate();
	});
</script>
<h3>Đăng bài viết</h3>
<form id = "FormDangBaiViet" action="index.php?do=baiviet_them_xuly" method="post" enctype="multipart/form-data">
	<table class="FormDangBaiViet">
		<tr>
			<td>
				<span class="MyFormLabel">Tiêu đề:</span>
				<input type="text" name="TieuDe" class = "required"/>
			</td>
		</tr>
		<tr>
			<td>
				<span class="MyFormLabel">Chủ đề:</span>
				<select name="ChuDe" class = "required">
					<option value="">-- Chọn --</option>
					<?php
						$chude = new chudebs();
						$danhsach = $chude->GetList();
						
						for($i = 0; $i < ($danhsach == false ? 0 : count($danhsach)); $i++)
						{
							echo "<option value='" . $danhsach[$i]['MaChuDe'] . "'>" . $danhsach[$i]['TenChuDe'] . "</option>";
						}
					?>
				</select>
			</td>
		</tr>
		<tr>
			<td>
				<span class="MyFormLabel">Tóm tắt:</span>
				<textarea name="TomTat" class = "required"></textarea>
			</td>
		</tr>
		<tr>
			<td>
				<span class="MyFormLabel">Hình ảnh:</span>
				<input type="file" name="HinhAnh" size="50" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="MyFormLabel">Tên ảnh:</span>
				<input type="text" name="TenAnh" size="50" />
			</td>
		</tr>
		<tr>
			<td>
				<span class="MyFormLabel">Nội dung bài viết:</span>
				<textarea name="NoiDung" class = "required"></textarea>
				<script type="text/javascript">
					var editor = CKEDITOR.replace('NoiDung');
				</script>
			</td>
		</tr>
	</table>
	
	<input type="submit" value="Đăng bài" />
</form>